package com.diguage.dytecode.dynamicproxy;

import java.util.Random;
import java.util.concurrent.TimeUnit;

/**
 * Created by diguage on 16-9-4.
 */
public class UserServiceImpl implements UserService {
    public String getNameById(int userId) throws InterruptedException {
        TimeUnit.MILLISECONDS.sleep(new Random().nextInt(2000));
        return "Name_"+userId;
    }

    public String login(String userName, String passwd) throws InterruptedException {
        TimeUnit.MILLISECONDS.sleep(new Random().nextInt(2000));
        return "User_" + userName + "_" + passwd;
    }
}
